package com.southern.gateway.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

import com.southern.gateway.filter.LocationFilter;
import com.southern.gateway.filter.PermissionCheckFilter;



@Configuration
public class FilterConfig {
	
	@Bean
	@Order(Ordered.HIGHEST_PRECEDENCE)
	public PermissionCheckFilter permissionCheckFilter() {
		PermissionCheckFilter globalFilter = new PermissionCheckFilter();
		return globalFilter;
	}
	
	
	@Bean
	public LocationFilter locationFilter() {
		LocationFilter filter = new LocationFilter();
		return filter;
	}
}
